package com.westos.userauth.dao.impl;

import com.westos.userauth.dao.UserLoginSecurityQuestionDao;
import com.westos.userauth.dao.mybatis.UserLoginSecurityQuestionDAO;
import com.westos.userauth.domain.UserLogin;
import com.westos.userauth.domain.UserLoginSecurityQuestion;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import java.util.List;
//王实
@Service
public class MybatisUserLoginSecurityQuestionDao implements UserLoginSecurityQuestionDao {

    //引入mybatis的实现
    @Autowired
    private UserLoginSecurityQuestionDAO userLoginSecurityQuestionDAO;

    @Override
    public int updateSecurityQuestion(UserLoginSecurityQuestion question) {
        return userLoginSecurityQuestionDAO.updateSecurityQuestion(question);
    }

    @Override
    public int deleteSecurityQuestion(UserLoginSecurityQuestion question) {
        return userLoginSecurityQuestionDAO.deleteSecurityQuestion(question);
    }

    @Override
    public List<UserLoginSecurityQuestion> queryByUserLogin(UserLogin userLogin) {
        return userLoginSecurityQuestionDAO.queryByUserLogin(userLogin);
    }

    @Override
    public int insertSecurityQuestion(UserLoginSecurityQuestion question) {
        return userLoginSecurityQuestionDAO.insertSecurityQuestion(question);
    }

    @Override
    public UserLoginSecurityQuestion queryUserLoginSecurityQuestionById(String questionEnumId) {
        return userLoginSecurityQuestionDAO.queryUserLoginSecurityQuestionById(questionEnumId);
    }
}
